# Maintainer: George Rawlinson <grawlinson@archlinux.org>
# Contributor: Padraic Fanning <fanninpm AT miamioh DOT edu>

pkgname=python-darkdetect
pkgver=0.8.0
pkgrel=2
pkgdesc='Detect OS Dark Mode from Python'
arch=('any')
url='https://github.com/albertosottile/darkdetect'
license=('BSD')
depends=('python')
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
_commit='64ce54e20be54cc41f85c8c208d35a4137b958d3'
source=("$pkgname::git+$url.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
